-- --------------------------------------- --
-- 本脚本用于删除定时任务相关的菜单和权限
-- --------------------------------------- --
SET NAMES utf8mb4;
BEGIN;

-- 删除权限
DELETE
FROM `system_permission`
WHERE `code` = 'system:job:create'
   OR `code` = 'system:job:delete'
   OR `code` = 'system:job:update'
   OR `code` = 'system:job:query'
   OR `code` = 'system:job:trigger'
   OR `code` = 'system:job:log:query'
   OR `code` = 'system:job:log:delete';

-- 删除菜单功能
DELETE
FROM `system_menu_func`
WHERE `menu_id` IN (SELECT `id`
                    FROM `system_menu`
                    WHERE `name` = '定时任务'
                       OR `name` = '任务管理'
                       OR `name` = '任务日志');
-- 删除菜单
DELETE
FROM system_menu
WHERE `name` = '定时任务'
   OR `name` = '任务管理'
   OR `name` = '任务日志';

COMMIT;
